using UnityEngine;
using System.Collections;

public class screenManager : MonoBehaviour {
	private bool ischanged = false;
	public enum GameState { INTRO, MENU, GAMEOVER, THEEND, CREDITOS};
	
	private GameState actualState;
	// Use this for initialization
	void Start () {
				//Application.LoadLevel("Intro");
		
	}
	
	// Update is called once per frame
	void Update()
	{
		if(Input.GetKey(KeyCode.Space))
			{
			ChangeState(GameState.MENU);
			}
	}
	
	public void ChangeState(GameState state)
	{
		ischanged = true;
		actualState = state;
		
		switch(actualState)
		{
		case GameState.INTRO:
			{
				Application.LoadLevel("Intro");
			}
			break;
			
		case GameState.MENU:
			{
				Application.LoadLevel("Menu");
			}
			break;
			
		case GameState.GAMEOVER:
			{
				Application.LoadLevel("GameOver");
			}
			break;
			
		case GameState.THEEND:
			{
				Application.LoadLevel("TheEnd");
			}
			break;
			
		case GameState.CREDITOS:
			{
				Application.LoadLevel("Creditos");
			}
			break;
		}
	}
	
}
